/** 
 * Project Name:ZhiWeiCateringManagementSystem 
 * File Name:UserLoginRecordAction.java 
 * Package Name:cn.ccit.servers 
 * Date:2016年11月5日下午7:18:38 
 * Copyright (c) 2016, 120026139@qq.com All Rights Reserved. 
 * 
*/  
  
package cn.ccit.action;  

import java.util.List;

import com.opensymphony.xwork2.ModelDriven;

import cn.ccit.entites.record.UserLoginRecord;
import cn.ccit.iservers.IUserLoginRecordServers;
import cn.ccit.model.BaseModel;
import cn.ccit.servers.UserLoginRecordServers;

/** 
 * ClassName:UserLoginRecordAction <br/> 
 * Function: 用户登录记录 <br/> 
 * Reason:    <br/> 
 * Date:     2016年11月5日 下午7:18:38 <br/> 
 * @author   Administrator 
 * @version   
 * @since    JDK 1.6 
 * @see       
 */
public class UserLoginRecordAction extends BaseRecordAction implements ModelDriven<UserLoginRecord>{
	
	/** 
	 * serialVersionUID:(版本号). 
	 * @since JDK 1.6 
	 */   
	private static final long serialVersionUID = 1L;
	private IUserLoginRecordServers userLoginRecord =new UserLoginRecordServers();
	private UserLoginRecord ulr =new UserLoginRecord();
	
	@Override
	public String addData() {
		sendJsonData(userLoginRecord.addUserLoginRecord(ulr), new BaseModel<UserLoginRecord>());
		return super.addData();
	}

	@Override
	public String removeData() {
		sendJsonData(userLoginRecord.removeUserLoginRecord(ulr), new BaseModel<UserLoginRecord>());
		return super.removeData();
	}

	@Override
	public String changeDataInfo() {
		sendJsonData(userLoginRecord.changeUserLoginRecordInfo(ulr), new BaseModel<UserLoginRecord>());
		return super.changeDataInfo();
	}

	@Override
	public String getDataList() {
		sendJsonDataList(userLoginRecord.getSomeUserLoginRecords(startId, limit), 
				new BaseModel<List<UserLoginRecord>>());
		return super.getDataList();
	}

	@Override
	public String sreachDataById() {
		UserLoginRecord ul=userLoginRecord.searchUserLoginRecordByID(ulr.getId());
		sendJsonData(ul!=null,
				new BaseModel<UserLoginRecord>(),
				ul);
		return super.sreachDataById();
	}

	

	@Override
	public UserLoginRecord getModel() {
		return ulr;
	}

	@Override
	public String searchDataListByYear() {
		sendJsonDataList(userLoginRecord.searchUserLoginRecordByYear(ulr.getOrderYear()),
				new BaseModel<List<UserLoginRecord>>());
		return super.searchDataListByYear();
	}

	@Override
	public String searchDataListByMonth() {
		sendJsonDataList(userLoginRecord.searchUserLoginRecordByMonth(ulr.getOrderMonth()),
				new BaseModel<List<UserLoginRecord>>());
		return super.searchDataListByMonth();
	}

	@Override
	public String searchDataListByDate() {
		sendJsonDataList(userLoginRecord.searchUserLoginRecordByDate(ulr.getOrderDate()),
				new BaseModel<List<UserLoginRecord>>());
		return super.searchDataListByDate();
	}
	

}
